
	<?php
		echo $this->Html->css('../plugins/fancybox/jquery.fancybox-1.3.4');
		
		echo $this->Html->script('../plugins/fancybox/jquery.mousewheel-3.0.4.pack');
		echo $this->Html->script('../plugins/fancybox/jquery.fancybox-1.3.4.pack');
	?>
<div id="content">
				<!-- main news -->
				<div id="left">
					<div id="page-title">
						<?php echo  $title_for_layout?>
						
						
					</div>				
					<div id="main-news-description">
						<?php if(isset($gallerydata) && count($gallerydata)>0){?>
						<div id="item-gallery-title" style="margin-top:20px;">
							Hình ảnh sản phẩm:
						</div>
						<div id="item-gallery-title" style="margin-top:20px;">
							<?php foreach($gallerydata as $k=>$v){?>
							<a rel="gallery1" title="<?php echo $k?>" class="fancy" href="<?php echo empty($v)?$this->webroot.'img/thumb_noimg.jpg':$this->webroot.'uploaded/'.$uses[2].'/large/'.$v;?>">				
								<img style="float:left;margin-left:10px;margin-top:10px;" width=60 src="<?php echo empty($v)?$this->webroot.'img/thumb_noimg.jpg':$this->webroot.'uploaded/'.$uses[2].'/thumb/'.$v;?>" id="main-news-img" />	
				
							</a>
							<?php }?>
							<div style="clear:both;height:20px;"></div>
						</div>
						<?php }?>
						<div id="item-price" style="margin-top:20px;">
							Giá bán: <?php echo $data[$uses[0]]['price']?>
						</div>
						<div style="margin-top:20px;">
							<?php echo $data[$uses[0]]['description']?>
						</div>
						<div style="margin-top:20px;">
							<center>
							<img alt="<?php echo $data[$uses[0]]['title']?>" src="<?php echo empty($data[$uses[0]]['image'])?$this->webroot.'img/thumb_noimg.jpg':$this->webroot.'uploaded/'.$uses[0].'/large/'.$data[$uses[0]]['image'];?>" />
							</center>
						</div>
						<div style="margin-top:20px;">
							<?php echo $data[$uses[0]]['content']?>
						</div>					
					</div>
					<div style="clear:both;height:20px;"></div>	
					<div>
						<div style="float:left;"><g:plusone size="medium" annotation="none"></g:plusone></div>
						<div style="float:left;margin-left:10px;" class="fb-like" data-href="<?php echo $this->Seo->link('/products/detail/'.$data[$uses[0]]['id']);?>" data-send="false" data-layout="button_count" data-width="10" data-show-faces="true"></div>
						<div  id="fbfacepile">
							<fb:facepile href="<?php echo $this->Seo->link('/products/detail/'.$data[$uses[0]]['id']);?>" width="300" max_rows="1"></fb:facepile>
						</div>
						<div style="clear:both;height:5px;"></div>
					</div>	
					
					<br />				
					<div class="fb-comments" data-href="<?php echo $this->Seo->link('/products/detail/'.$data[$uses[0]]['id']);?>" data-num-posts="<?php echo $webConfig['fbCommentNop']?>" data-width="650"></div>				
					<div id="fb-root"></div>
					
					<div style="clear:both;height:20px"></div>
				</div>	
				<!-- other news -->
				<?php if(count($data0)>0){?>
				<div id="right">
					<div id="others_title">Sản phẩm khác</div>
					<?php foreach($data0 as $k=>$v){?>
					<div class="other-news<?php echo (($k+1)%2+1)?>">
						<a title="<?php echo $v[$uses[0]]['name']?>" href="<?php echo $this->Seo->link('/products/detail/'.$v[$uses[0]]['id']);?>">
					<img alt="<?php echo $v[$uses[0]]['name']?>" width=91 src="<?php echo empty($v[$uses[0]]['image'])?$this->webroot.'img/thumb_noimg.jpg':$this->webroot.'uploaded/'.$uses[0].'/thumb/'.$v[$uses[0]]['image'];?>" />
						<?php echo $v[$uses[0]]['name']?>
						</a>
					</div>
					<?php }?>					
					<div style="clear:both;height:20px;"></div>
					<div id="main-news-more"><a href="<?php echo $this->Seo->link('/products/index/'.$data[$uses[0]]['product_category_id']);?>">Xem thêm</a></div>	
					<div style="clear:both;height:20px;"></div>
					<fb:activity 
					site="scyclub.com"
					app_id="204609776328294">
					</fb:activity>
					
					
									
				</div>
				<?php }?>
				<div style="clear:both;"></div>
				
				<div style="clear:both;height:20px"></div>
</div>



<script type="text/javascript">
//google
(function() {
  var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
  po.src = 'https://apis.google.com/js/plusone.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
//facebook
//for fb
var accessToken;
var uid;
window.fbAsyncInit = function() {
    FB.init({
      appId      : '204609776328294', // App ID
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });


    

    

    
  };

 
  (function(d){
      var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
      js = d.createElement('script'); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js";
      d.getElementsByTagName('head')[0].appendChild(js);
    }(document));
$("a.fancy").fancybox({
	'width'				: '100%',
	'height'			: '100%',
	'nextClick'			:true, 
	'autoScale'			: false,
	'transitionIn'		: 'none',
	'transitionOut'		: 'none'
		
	
});

</script>